home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991 …esperately Seeking Seven / Desperately Seeking Seven.2mg / Dev.CD.8 / Essentials / Tools / Technical.Notes / PDOS / TN.PDOS.025 < prev    next >
Encoding:
Text File  |  1990-01-19  |  9.9 KB  |  202 lines  |  [04] ASCII Text (0x0000)

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. ProDOS 8
  8. #25:    Non-Standard Storage Types
  9.  
  10. Written by:    Matt Deatherage                                      July 1989
  11.  
  12. This Technical Note discusses storage types for ProDOS files which are not 
  13. documented in the ProDOS 8 Technical Reference Manual.
  14.  
  15. Warning:  The information provided in this Note is for the use of disk 
  16.           utility programs which occasionally must manipulate non-
  17.           standard files in unusual situations.  ProDOS 8 programs 
  18.           should not create or otherwise manipulate files with non-
  19.           standard storage types.
  20. _____________________________________________________________________________
  21.  
  22.  
  23. Introduction
  24.  
  25. One of the features of the ProDOS file system is its ability to let ProDOS 8 
  26. know when someone has put a file on the disk that ProDOS 8 can't access.  A 
  27. file not created by ProDOS 8 can be identified by the storage_type field.  
  28. ProDOS 8 creates four different storage types:  seedling files ($1), sapling 
  29. files ($2), tree files ($3), and directory files ($D).  ProDOS 8 also stores 
  30. subdirectory headers as storage type $E and volume directory headers as 
  31. storage type $F.  These are all described in the ProDOS 8 Technical Reference 
  32. Manual.
  33.  
  34. Other files may be placed on the disk, and ProDOS 8 can catalog them, rename 
  35. them, and return file information about them.  However, since it does not know 
  36. how the information in the files is stored on the disk, it cannot perform 
  37. normal file operations on these files, and it returns the Unsupported Storage 
  38. Type error instead.
  39.  
  40. Apple reserves the right to define additional storage types for the extension 
  41. of the ProDOS file system in the future.  To date, two additional storage 
  42. types have been defined.  Storage type $4 indicates a Pascal area on a ProFile 
  43. hard disk, and storage type $5 indicates a GS/OS extended file (data fork and 
  44. resource fork) as created by the ProDOS FST.
  45.  
  46.  
  47. Storage Type $4
  48.  
  49. Storage type $4 is used for Apple II Pascal areas on Profile hard disk drives.  
  50. These files are created by the Apple Pascal ProFile Manager.  Other programs 
  51. should not create these files, as Apple II Pascal could freak out.
  52.  
  53. The Pascal Profile Manager (PPM) creates files which are internally divided 
  54. into pseudo-volumes by Apple II Pascal.  The files have the name PASCAL.AREA 
  55. (name length of 10), with file type $EF.  The key_pointer field of the 
  56. directory entry points to the first block used by the file, which is the 
  57. second to last block on the disk.  As ProDOS stores files non-contiguously up 
  58. from the bottom, PPM creates pseudo-volumes contiguously down from the end of 
  59. the ProFile.  Blocks_used is 2, and header_pointer is also 2.  All other 
  60. fields in the directory are set to 0.  PPM looks for this entry (starting with 
  61. the name PASCAL.AREA) to determine if a ProFile has been initialized for 
  62. Pascal use.
  63.  
  64. The file entry for the Pascal area increments the number of files in the 
  65. ProDOS directory and the key_pointer for the file points to TOTAL_BLOCKS - 2, 
  66. or the second to last block on the disk.  When PPM expands or contracts the 
  67. Pascal area, blocks_used and key_pointer are updated accordingly.  With any 
  68. access to this entry (such as adding or deleting pseudo-volumes within PPM), 
  69. the backup bit is not set (PPM provides a utility to back up the Pascal area).
  70.  
  71. The Pascal volume directory contains two separate contiguous data structures 
  72. that specify the contents of the Pascal area on the Profile.  The volume 
  73. directory occupies two blocks to support 31 pseudo-volumes.  It is found at 
  74. the physical block specified in the ProDOS volume directory as the value of 
  75. key_pointer (i.e., it occupies the first block in the area pointed to by this 
  76. value).
  77.  
  78. The first portion of the volume directory is the actual directory for the 
  79. pseudo-volumes.  It is an array with the following Apple II Pascal 
  80. declaration:
  81.  
  82. TYPE    RTYPE = (HEADER, REGULAR)
  83.  
  84. VAR     VDIR:    ARRAY [0..31] OF
  85.             PACKED RECORD
  86.                 CASE RTYPE OF
  87.                     HEADER:    (PSEUDO_DEVICE_LENGTH:INTEGER;
  88.                                CUR_NUM_VOLS:INTEGER;
  89.                                PPM_NAME:STRING[3]);
  90.                     REGULAR:   (START:INTEGER;
  91.                                DEFAULT_UNIT:0.255
  92.                                FILLER:0..127
  93.                                WP:BOOLEAN
  94.                                OLDDRIVERADDR:INTEGER
  95.             END;
  96.  
  97. The HEADER specifies information about the Pascal area.  It specifies the size 
  98. in blocks in PSEUDO_DEVICE_LENGTH, the number of currently allocated volumes 
  99. in CUR_NUM_VOLS, and a special validity check in PPM_NAME, which is the three-
  100. character string PPM.  The header information is accessed via a reference to 
  101. VDIR[0].  The REGULAR entry specifies information for each pseudo-volume.  
  102. START is the starting block address for the pseudo-volume, and LENGTH is the 
  103. length of the pseudo-volume in blocks.  DEFAULT_UNIT specifies the default 
  104. Pascal unit number that this pseudo-volume should be assigned to upon booting 
  105. the system.  This value is set through the Volume Manager by either the user 
  106. or an application program, and it remains valid if it is not released.
  107.  
  108. If the system is shut down, the pseudo-volume remains assigned and will be 
  109. active once the system is rebooted.  WP is a Boolean that specifies if the 
  110. pseudo-volume is write-protected.  OLDDRIVERADDR holds the address of this 
  111. unit's (if assigned) previous driver address.  It is used when normal floppy 
  112. unit numbers are assigned to pseudo-volumes, so when released, the floppies 
  113. can be reactivated.  Each REGULAR entry is accessed via an index from 1 to 31.  
  114. This index value is thus associated with a pseudo-volume.  All references to 
  115. pseudo-volumes in the Volume Manager are made with these indexes.
  116.  
  117. Immediately following the VDIR array is an array of description fields for 
  118. each pseudo-volume:
  119.  
  120.     VDESC:    ARRAY [0..31] OF STRING[15]
  121.  
  122. The description field is used to differentiate pseudo-volumes with the same 
  123. name.  It is set when the pseudo-volume is created.  This array is accessed 
  124. with the same index as VDIR.
  125.  
  126. The volume directory does not maintain the names of the pseudo-volumes.  These 
  127. are found in the directories in each pseudo-volume.  When the Volume Manager 
  128. is activated, it reads each pseudo-volume directory to construct an array of 
  129. the pseudo-volume names:
  130.  
  131.     VNAMES:   ARRAY [0..31] OF STRING[7]
  132.  
  133. Each pseudo-volume name is stored here so the Volume Manager can use it in its 
  134. display of pseudo-volumes.  The name is set when the pseudo-volume is created 
  135. and can be changed by the Pascal Filer.  The names in this array are accessed 
  136. via the same index as VDIR.  This array is set up when the Volume Manager is 
  137. initialized and after there is a delete of a pseudo-volume.  Creating a 
  138. pseudo-volume will add to the array at the end.
  139.  
  140. Pascal Pseudo-Volume Format
  141.  
  142. Each Pascal pseudo-volume is a standard UCSD formatted volume.  Blocks 0 and 1 
  143. are reserved for bootstrap loaders (which are irrelevant for pseudo-volumes).  
  144. The directory for the volume is in blocks 2 through 5 of the pseudo-volume.  
  145. When a pseudo-volume is created, the directory for that pseudo-volume is 
  146. initialized with the following values:
  147.  
  148. dfirstblock = 0            first logical block of the volume
  149. dlastblock = 6             first available block after the directory
  150. dvid    = name of the volume used in create
  151. deovblk = size of volume specified in create
  152. dnumfiles = 0              no files yet
  153. dloadtime = set to current system date
  154. dlastboot = 0
  155.  
  156. The Apple II Pascal 1.3 Manual contains the format for the UCSD directory.  
  157. Files within this subdirectory are allocated via the standard Pascal I/O 
  158. routines in a contiguous manner.
  159.  
  160.  
  161. Storage Type $5
  162.  
  163. Storage type $5 is used by the ProDOS FST in GS/OS to store extended files.  
  164. The key block of the file points to an extended key block entry.  The extended 
  165. key block entry contains mini-directory entries for both the data fork and 
  166. resource fork of the file.  The mini-entry for the data fork is at offset +000 
  167. of the extended key block, and the mini-entry for the resource fork is at 
  168. offset +$100 (+256 decimal).
  169.  
  170. The format for mini-entries is as follows:
  171.  
  172. storage_type    (+000)    Byte    The standard ProDOS storage 
  173.                                   type for this fork of the file.  
  174.                                   Note that for regular directory 
  175.                                   entries, the storage type is the 
  176.                                   high nibble of a byte that contains 
  177.                                   the length of the filename as the 
  178.                                   low nibble.  In mini-entries, the 
  179.                                   high nibble is reserved and must be 
  180.                                   zero, and the storage type is 
  181.                                   contained in the low nibble.
  182. key_block       (+001)    Word    The block number of the key 
  183.                                   block of this fork.  This value and 
  184.                                   the value of storage_type combine to 
  185.                                   determine how to find the data in 
  186.                                   the file, as documented in the 
  187.                                   ProDOS 8 Technical Reference Manual.
  188. blocks_used     (+003)    Word    The number of blocks used by 
  189.                                   this fork of the file.
  190. EOF             (+005)    3 Bytes Three-byte value (least 
  191.                                   significant byte stored first) 
  192.                                   representing the end-of-file value 
  193.                                   for this fork of the file.
  194.  
  195. All remaining bytes in the extended key block are reserved and must be zero.
  196.  
  197.  
  198. Further Reference
  199. _____________________________________________________________________________
  200.     o    Apple II Pascal ProFile Manager Manual
  201.     o    GS/OS Reference
  202.     o    ProDOS 8 Technical Reference Manual